from flask import  Flask,g,request
from Controller.process import page
app=Flask(__name__)

blueprint=[page]

def bootstrap(app):
    for item in blueprint:
        app.register_blueprint(item)

    @app.before_request
    def before():
        args = {k: v for k, v in dict(request.args).items()}
        args_form = {k: v for k, v in dict(request.form).items()}
        args.update(args_form)
        g.args = args
        print('boostrap截取的参数为:')
        print(g.args)

if __name__=="__main__":
    bootstrap(app)
    app.run(port=2020,host="127.0.0.1",debug=True,processes=True)
